import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/projectSub',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/projectSub/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/projectSub',
    method: 'put',
    data
  })
}

// 获取用户列表
export function usersList(data) {
  return request({
    url: 'api/users/findList/',
    method: 'post',
    data
  })
}
// 启动子项
export function detail(params) {
  return request({
    url: 'api/projectSub/detail',
    method: 'get',
    params
  })
}
// 启动子项
export function start(params) {
  return request({
    url: 'api/projectSub/start',
    method: 'get',
    params
  })
}
// 更新子项
export function update(params) {
  return request({
    url: 'api/projectSub/update',
    method: 'get',
    params
  })
}
// 上传模型
export function modelUrlUpload(data) {
  return request({
    url: 'api/model/url_upload',
    method: 'post',
    data
  })
}
// 取得全部模型信息
export function allModelList(data) {
  return request({
    url: 'api/model/listAll',
    method: 'post',
    data
  })
}
// 子项链接
export function subLink(params) {
  return request({
    url: 'api/projectSub/link',
    method: 'get',
    params
  })
}
/* 坐标添加*/
export function addCoordinates(data) {
  return request({
    url: 'api/projectSub/createPosition',
    method: 'post',
    data
  })
}
/* 根据子项编号查询子项*/
export function detailByNo(params) {
  return request({
    url: 'api/projectSub/detailByNo',
    method: 'get',
    params
  })
}
// 取得涉及专业数据
export function projectDiscipline(params) {
  return request({
    url: 'api/projectSub/discipline',
    method: 'get',
    params
  })
}
// 模型上传
export function upLoadModel(data) {
  return request({
    url: 'api/model/upload',
    method: 'post',
    data
  })
}
// 判断工段号是否重复
export function checkWorkSection(params) {
  return request({
    url: 'api/subWorkSection/checkWorkSection',
    method: 'get',
    params
  })
}
export default { add, edit, del, usersList, detail, start, update, modelUrlUpload, allModelList, subLink, detailByNo, projectDiscipline, upLoadModel }
